package com.dcliment.jukebox
{
	import com.dcliment.jukebox.controllers.JukeBoxController;
	import com.dcliment.jukebox.display.views.JukeBoxView;
	import com.dcliment.jukebox.models.JukeBoxModel;
	import com.dcliment.utils.SWFProfiler;
	
	import flash.display.DisplayObjectContainer;
	import flash.display.StageDisplayState;
	import flash.events.EventDispatcher;
	
	/**
	 * _
	 * 
	 * @author dcliment
	 * version 1.0 
	 */	
	public class JukeBox extends EventDispatcher
	{
		private var _model:JukeBoxModel;
		private var _controller:JukeBoxController;
		private var _view:JukeBoxView;
		//
		private var _docClass:DisplayObjectContainer

		public function JukeBox($docClass:DisplayObjectContainer, $xmlURL:String)
		{
			_docClass = $docClass;
			
			_docClass.stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
			
			_model = new JukeBoxModel(_docClass.stage);
			_view = new JukeBoxView();
			_controller = new JukeBoxController(_model, _view);
			_controller.loadXML($xmlURL);
			_docClass.addChild(_view);
			
			// SWF Profiler DISABLE before release
			SWFProfiler.init(_docClass.stage, _docClass);
		}
	}
}